#include "faction.h"


using namespace std;


std::map<std::string, std::shared_ptr<Faction>> Faction::factionMap;


void Faction::add(shared_ptr<Faction> faction)
{
	factionMap[faction->id] = faction;
}


shared_ptr<Faction> Faction::get(string id)
{
	shared_ptr<Faction>	faction;

	map<string, shared_ptr<Faction>>::iterator i;
	i = factionMap.find(id);
	if (i != factionMap.end())
	{
		faction = i->second;
	}

	return faction;
}


map<string, shared_ptr<Faction>>& Faction::getFactionMap()
{
	return factionMap;
}